Objects Reference

bsp_object::ray_intersect

Prototype

virtual mesh *ray_intersect(vector& ro,vector& rd,vector& ip,float& dist,int& facenum,float rad=0.0f)

Parameters

Parameter Type Description
ro vector& ray origin
rd vector& ray direction
ip vector& intersection point
dist float& intersection distance
facenum int& intersected face index
rad float collision radius

Return Value

Returns the intersected mesh or NULL for no intersection.

Remarks

This virtual function implements a ray intersection with the object. It should return the closest collision.

Its default behavior is to call get_mesh and if it returns a mesh, call the mesh ray_intersect.